<div class="heading">
<div class="left_heading"></div>

<div class="content_heading">
<h3>Thêm danh mục mới</h3>
</div>

<div class="right_heading"></div>
</div><!-- End .heading -->

<div class="main_content">
	<form name="create_area" action="" method="post">
		<table class="table_content">
			<tr>
				<td class="label"><?php echo $this->formLabel('cat_name', 'Tên danh mục'); ?><span class="msg"> * </span></td>
				<td class="label2"><?php echo $this->formText('cat_name', null, array('id' => 'cat_name', 'class' => 'input')); ?></td>
				<td><span class="msg"><?php echo $this->errorCatName; ?></span></td>
			</tr>
			<tr>
				<td class="label"><?php echo $this->formLabel('parents', 'Danh mục cha'); ?></td>
				<td class="label2" colspan="2">
					<select name="parents" id="parents" class="input">
						<?php foreach($this->data as $value) :
							$levelCss = '';
				            if($value['level'] == 0){
				            	$name = $value['cat_name'];
				            }else if($value['level'] == 1){
				            	$name = ' + ' . $value['cat_name'];
				            }else{
				            	$name = ' - - ' . $value['cat_name'];
				            	$levelCss =  'padding-left: ' . (10 * $value['level']) . 'px;';
				            }
			            ?>
						<option value="<?php echo $value['cat_id']; ?>" style="<?php echo $levelCss; ?>"><?php echo $name; ?></option>
						<?php endforeach; ?>
					</select>
				</td>
			</tr>
            <tr>
                <td class="label"><?php echo $this->formLabel('link', 'Đường dẫn điều khiển'); ?></td>
                <td class="label2"><?php echo $this->formText('link', null, array('id' => 'link', 'class' => 'input')); ?></td>
            </tr>
			<tr>
				<td class="label">&nbsp;</td>
				<td colspan="2"><span class="msg"><?php echo $this->error; ?></span></td>
			</tr>
			<tr>
				<td class="label">&nbsp;</td>
				<td colspan="2">
					<input class="button" type="submit" name="submit" value="Tạo mới">
					<input class="button" type="reset" name="reset" value="Nhập lại">
					<a href="<?php echo $this->baseUrl('admin-dthink/category'); ?>" class="button" style="padding-top: 7px;">Quay lại</a>
				</td>
			</tr>
        </table>
    </form>
</div><!-- End .main_content -->  